import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import {
	localStorage
} from 'mp-storage'
import state from './state'
import mutations from "./mutations"
import actions from "./actions"
import getters from "./getters"
import user from './modules/user'
import tabbar from './modules/tabbar'
import admin from './modules/admin'

Vue.use(Vuex)

export default new Vuex.Store({
	state,
	getters,
	actions,
	mutations,
	modules: {
		user,
		admin,
		tabbar
	},
	plugins: [createPersistedState({
		storage: localStorage
	})]
})
